angular.module('userModule', []).controller('userCtr', ctrFn);

ctrFn.$inject = ['$scope', '$rootScope','$location','checkLoginFactory'];

function ctrFn($scope, $rootScope,$location,checkLoginFactory) {
    checkLoginFactory.checkLogin();
    $scope.user = $rootScope.loginUser;
    $scope.user=$scope.user?$scope.user:'请登录';
    $scope.userLogin=function(){
        if($scope.user=='请登录'){
            $location.path('login');
        }
    }
}